package com.pond.pond.service.impl;

import java.util.List;
import com.pond.common.core.utils.DateUtils;
import com.pond.pond.domain.vo.FishTypeOptionsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pond.pond.mapper.FishTypeMapper;
import com.pond.pond.domain.FishType;
import com.pond.pond.service.IFishTypeService;

/**
 * 鱼种类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-13
 */
@Service
public class FishTypeServiceImpl implements IFishTypeService 
{
    @Autowired
    private FishTypeMapper fishTypeMapper;

    /**
     * 查询鱼种类
     * 
     * @param id 鱼种类主键
     * @return 鱼种类
     */
    @Override
    public FishType selectFishTypeById(Long id)
    {
        return fishTypeMapper.selectFishTypeById(id);
    }

    /**
     * 查询鱼种类列表
     * 
     * @param fishType 鱼种类
     * @return 鱼种类
     */
    @Override
    public List<FishType> selectFishTypeList(FishType fishType)
    {
        return fishTypeMapper.selectFishTypeList(fishType);
    }

    /**
     * 鱼种类Options
     *
     * @return 鱼塘名称列表
     */
    @Override
    public List<FishTypeOptionsVo> selectFishTypeOptionList()
    {
        return fishTypeMapper.selectFishTypeOptionList();
    }

    /**
     * 新增鱼种类
     * 
     * @param fishType 鱼种类
     * @return 结果
     */
    @Override
    public int insertFishType(FishType fishType)
    {
        fishType.setCreateTime(DateUtils.getNowDate());
        return fishTypeMapper.insertFishType(fishType);
    }

    /**
     * 修改鱼种类
     * 
     * @param fishType 鱼种类
     * @return 结果
     */
    @Override
    public int updateFishType(FishType fishType)
    {
        fishType.setUpdateTime(DateUtils.getNowDate());
        return fishTypeMapper.updateFishType(fishType);
    }

    /**
     * 批量删除鱼种类
     * 
     * @param ids 需要删除的鱼种类主键
     * @return 结果
     */
    @Override
    public int deleteFishTypeByIds(Long[] ids)
    {
        return fishTypeMapper.deleteFishTypeByIds(ids);
    }

    /**
     * 删除鱼种类信息
     * 
     * @param id 鱼种类主键
     * @return 结果
     */
    @Override
    public int deleteFishTypeById(Long id)
    {
        return fishTypeMapper.deleteFishTypeById(id);
    }
}
